<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>话题列表 - 高级筛选</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4285F4;
            --secondary: #8E24AA;
            --success: #0F9D58;
            --warning: #FF9800;
            --danger: #F44336;
            --text-primary: #202124;
            --text-secondary: #5F6368;
            --text-tertiary: #9AA0A6;
            --bg-light: #F8F9FA;
            --bg-white: #FFFFFF;
            --border-light: #E0E0E0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 14px;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
        }
        
        /* 筛选工具栏 */
        .filter-toolbar {
            display: flex;
            background-color: var(--bg-white);
            padding: 8px 16px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-btn {
            flex: 1;
            padding: 6px 0;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .filter-btn.active {
            color: var(--primary);
        }
        
        /* 分类标签筛选 */
        .category-filter {
            background-color: var(--bg-white);
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .category-filter::-webkit-scrollbar {
            display: none;
        }
        
        .category-tags {
            display: flex;
            gap: 8px;
            min-width: max-content;
        }
        
        .category-tag {
            padding: 6px 16px;
            background-color: var(--bg-light);
            border-radius: 16px;
            font-size: 14px;
            color: var(--text-secondary);
            white-space: nowrap;
            border: none;
        }
        
        .category-tag.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 高级筛选面板 */
        .advanced-filter-panel {
            background-color: var(--bg-white);
            padding: 16px;
            border-bottom: 1px solid var(--border-light);
            display: none;
        }
        
        .advanced-filter-panel.show {
            display: block;
        }
        
        .filter-section {
            margin-bottom: 16px;
        }
        
        .filter-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-primary);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .filter-option {
            padding: 6px 14px;
            border: 1px solid var(--border-light);
            border-radius: 16px;
            font-size: 14px;
            color: var(--text-secondary);
            background: none;
        }
        
        .filter-option.active {
            border-color: var(--primary);
            color: var(--primary);
            background-color: rgba(66, 133, 244, 0.1);
        }
        
        .date-range {
            display: flex;
            gap: 10px;
        }
        
        .date-input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid var(--border-light);
            border-radius: 8px;
            font-size: 14px;
            color: var(--text-secondary);
        }
        
        .filter-actions {
            display: flex;
            gap: 12px;
            margin-top: 16px;
        }
        
        .reset-filter {
            flex: 1;
            padding: 10px;
            background-color: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            font-size: 15px;
            color: var(--text-secondary);
        }
        
        .apply-filter {
            flex: 1;
            padding: 10px;
            background-color: var(--primary);
            border: none;
            border-radius: 8px;
            font-size: 15px;
            color: white;
        }
        
        /* 标签云筛选 */
        .tag-cloud {
            background-color: var(--bg-white);
            padding: 16px;
            border-bottom: 1px solid var(--border-light);
            display: none;
        }
        
        .tag-cloud.show {
            display: block;
        }
        
        .tag-item {
            display: inline-block;
            padding: 5px 12px;
            background-color: var(--bg-light);
            border-radius: 16px;
            font-size: 13px;
            color: var(--text-secondary);
            margin: 0 6px 8px 0;
            border: none;
        }
        
        .tag-item.active {
            background-color: var(--secondary);
            color: white;
        }
        
        .tag-item.hot {
            font-weight: 600;
        }
        
        /* 筛选结果统计 */
        .filter-result {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            font-size: 14px;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .active-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }
        
        .active-filter-tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px;
            background-color: rgba(66, 133, 244, 0.1);
            border-radius: 12px;
            font-size: 12px;
            color: var(--primary);
        }
        
        .remove-filter {
            background: none;
            border: none;
            color: var(--primary);
            cursor: pointer;
            font-size: 14px;
        }
        
        /* 话题列表容器 */
        .topics-container {
            padding: 12px 16px;
        }
        
        /* 话题卡片通用样式 */
        .topic-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            overflow: hidden;
            transition: transform 0.2s ease;
        }
        
        .topic-card:hover {
            transform: translateY(-2px);
        }
        
        /* 话题头部 */
        .topic-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .topic-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .topic-creator {
            flex: 1;
        }
        
        .creator-name {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .creator-badge {
            font-size: 10px;
            padding: 1px 5px;
            border-radius: 4px;
            background-color: var(--primary);
            color: white;
        }
        
        .topic-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        
        /* 话题内容 */
        .topic-content {
            padding: 0 16px 12px;
        }
        
        .topic-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 8px;
            line-height: 1.5;
        }
        
        .topic-text {
            font-size: 15px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            line-height: 1.6;
        }
        
        /* 话题图片样式 */
        .topic-single-image .topic-images {
            margin-bottom: 12px;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .topic-single-image .topic-image img {
            width: 100%;
            height: auto;
            display: block;
        }
        
        .topic-multi-image .topic-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .topic-multi-image .topic-image {
            aspect-ratio: 1/1;
            overflow: hidden;
        }
        
        .topic-multi-image .topic-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 话题标签 */
        .topic-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .topic-tag {
            padding: 4px 10px;
            background-color: var(--bg-light);
            border-radius: 16px;
            font-size: 12px;
            color: var(--primary);
        }
        
        /* 话题数据统计 */
        .topic-stats {
            display: flex;
            justify-content: space-between;
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            font-size: 13px;
        }
        
        .topic-stat {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-tertiary);
        }
        
        /* 话题操作按钮 */
        .topic-actions {
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            border-top: 1px solid var(--border-light);
        }
        
        .topic-action {
            flex: 1;
            padding: 8px 0;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .topic-action:hover, .topic-action.active {
            color: var(--primary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 70px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 22px;
        }
        
        /* 创建话题按钮 */
        .fab-create {
            position: fixed;
            right: 24px;
            bottom: 86px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
            border: none;
            font-size: 24px;
            z-index: 999;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 90px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 加载更多 */
        .load-more {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
            font-size: 15px;
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        /* 空状态 */
        .empty-state {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-tertiary);
            display: none;
        }
        
        .empty-state.show {
            display: block;
        }
        
        .empty-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }
        
        .empty-text {
            font-size: 16px;
            margin-bottom: 24px;
        }
        
        .reset-all-btn {
            padding: 8px 24px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 20px;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">话题广场</div>
        <button class="nav-btn" id="messageBtn">
            <i class="far fa-bell"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索话题或内容...">
        </div>
    </div>
    
    <!-- 筛选工具栏 -->
    <div class="filter-toolbar">
        <button class="filter-btn active" id="categoryFilterBtn">
            <i class="fas fa-th-large"></i>
            <span>分类</span>
        </button>
        <button class="filter-btn" id="advancedFilterBtn">
            <i class="fas fa-sliders-h"></i>
            <span>筛选</span>
        </button>
        <button class="filter-btn" id="tagFilterBtn">
            <i class="fas fa-tags"></i>
            <span>标签</span>
        </button>
        <button class="filter-btn" id="sortFilterBtn">
            <i class="fas fa-sort"></i>
            <span>排序</span>
        </button>
    </div>
    
    <!-- 分类标签筛选 -->
    <div class="category-filter" id="categoryFilterPanel">
        <div class="category-tags">
            <button class="category-tag active">全部话题</button>
            <button class="category-tag">推荐话题</button>
            <button class="category-tag">热门讨论</button>
            <button class="category-tag">科技</button>
            <button class="category-tag">娱乐</button>
            <button class="category-tag">体育</button>
            <button class="category-tag">美食</button>
            <button class="category-tag">旅行</button>
            <button class="category-tag">教育</button>
            <button class="category-tag">健康</button>
            <button class="category-tag">财经</button>
            <button class="category-tag">职场</button>
        </div>
    </div>
    
    <!-- 高级筛选面板 -->
    <div class="advanced-filter-panel" id="advancedFilterPanel">
        <div class="filter-section">
            <div class="filter-title">时间范围</div>
            <div class="filter-options">
                <button class="filter-option active">全部时间</button>
                <button class="filter-option">今天</button>
                <button class="filter-option">近3天</button>
                <button class="filter-option">近一周</button>
                <button class="filter-option">近一个月</button>
                <button class="filter-option">自定义</button>
            </div>
            
            <div class="date-range" style="display: none; margin-top: 10px;">
                <input type="date" class="date-input" placeholder="开始日期">
                <input type="date" class="date-input" placeholder="结束日期">
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">内容类型</div>
            <div class="filter-options">
                <button class="filter-option active">全部内容</button>
                <button class="filter-option">纯文字</button>
                <button class="filter-option">含图片</button>
                <button class="filter-option">含视频</button>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">热门程度</div>
            <div class="filter-options">
                <button class="filter-option active">全部</button>
                <button class="filter-option">高热度</button>
                <button class="filter-option">中等热度</button>
                <button class="filter-option">新发布</button>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">作者类型</div>
            <div class="filter-options">
                <button class="filter-option active">全部作者</button>
                <button class="filter-option">官方账号</button>
                <button class="filter-option">认证达人</button>
                <button class="filter-option">普通用户</button>
            </div>
        </div>
        
        <div class="filter-actions">
            <button class="reset-filter" id="resetAdvancedFilter">重置</button>
            <button class="apply-filter" id="applyAdvancedFilter">应用筛选</button>
        </div>
    </div>
    
    <!-- 标签云筛选 -->
    <div class="tag-cloud" id="tagFilterPanel">
        <div class="filter-title">热门标签</div>
        <button class="tag-item hot active">全部标签</button>
        <button class="tag-item hot">#人工智能</button>
        <button class="tag-item hot">#旅行攻略</button>
        <button class="tag-item hot">#美食分享</button>
        <button class="tag-item">#电影推荐</button>
        <button class="tag-item">#健身打卡</button>
        <button class="tag-item">#职场技巧</button>
        <button class="tag-item">#读书感悟</button>
        <button class="tag-item">#摄影技巧</button>
        <button class="tag-item">#理财知识</button>
        <button class="tag-item">#健康饮食</button>
        <button class="tag-item">#亲子教育</button>
        <button class="tag-item">#数码评测</button>
        <button class="tag-item">#穿搭指南</button>
        <button class="tag-item">#音乐分享</button>
        <button class="tag-item">#游戏攻略</button>
        <button class="tag-item">#历史知识</button>
        <button class="tag-item">#心理学</button>
    </div>
    
    <!-- 排序筛选面板 -->
    <div class="advanced-filter-panel" id="sortFilterPanel">
        <div class="filter-section">
            <div class="filter-title">排序方式</div>
            <div class="filter-options">
                <button class="filter-option active">推荐排序</button>
                <button class="filter-option">最新发布</button>
                <button class="filter-option">最热讨论</button>
                <button class="filter-option">最多点赞</button>
                <button class="filter-option">最多收藏</button>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">显示密度</div>
            <div class="filter-options">
                <button class="filter-option active">标准模式</button>
                <button class="filter-option">紧凑模式</button>
                <button class="filter-option">大图模式</button>
            </div>
        </div>
        
        <div class="filter-actions">
            <button class="reset-filter" id="resetSortFilter">重置</button>
            <button class="apply-filter" id="applySortFilter">应用排序</button>
        </div>
    </div>
    
    <!-- 筛选结果统计 -->
    <div class="filter-result">
        <div>找到 <span style="color: var(--primary); font-weight: 600;">248</span> 个话题</div>
        <button class="filter-btn" id="clearAllFilters" style="padding: 4px 8px;">
            <i class="fas fa-times"></i>
            <span>清除筛选</span>
        </button>
        
        <div class="active-filters" id="activeFiltersContainer">
            <!-- 动态显示选中的筛选条件 -->
            <div class="active-filter-tag">
                科技 <button class="remove-filter"><i class="fas fa-times"></i></button>
            </div>
            <div class="active-filter-tag">
                近一周 <button class="remove-filter"><i class="fas fa-times"></i></button>
            </div>
            <div class="active-filter-tag">
                #人工智能 <button class="remove-filter"><i class="fas fa-times"></i></button>
            </div>
        </div>
    </div>
    
    <!-- 话题列表容器 -->
    <div class="topics-container">
        <!-- 多图话题 -->
        <div class="topic-card topic-multi-image">
            <div class="topic-header">
                <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">
                        科技前沿
                        <span class="creator-badge">官方</span>
                    </div>
                    <div class="topic-time">今天 09:45</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">新一代AI芯片发布，性能提升300%！</div>
                
                <div class="topic-text">
                    最新发布的AI芯片采用了全新架构，在算力和能效比上都有了质的飞跃。实测数据显示，其AI模型训练速度比上一代提升了300%，而功耗却降低了40%。这将为大模型训练和边缘计算带来革命性变化...
                </div>
                
                <div class="topic-images">
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/1/600/600" alt="话题图片1">
                    </div>
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/2/600/600" alt="话题图片2">
                    </div>
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#人工智能#</span>
                    <span class="topic-tag">#芯片#</span>
                    <span class="topic-tag">#科技前沿#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>15.2k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>432 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action active">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (2.1k)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 单图话题 -->
        <div class="topic-card topic-single-image">
            <div class="topic-header">
                <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">
                        AI研究员小张
                        <span class="creator-badge">认证</span>
                    </div>
                    <div class="topic-time">昨天 15:32</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">我用GPT-4开发了一个智能助手，附使用体验</div>
                
                <div class="topic-text">
                    过去一周，我基于GPT-4 API开发了一个个人智能助手，集成了日程管理、邮件处理和文档摘要功能。使用下来最大的感受是...
                </div>
                
                <div class="topic-images">
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/3/800/500" alt="话题图片">
                    </div>
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#人工智能#</span>
                    <span class="topic-tag">#GPT4#</span>
                    <span class="topic-tag">#开发体验#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>8.7k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>215 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (932)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 无图话题 -->
        <div class="topic-card">
            <div class="topic-header">
                <img src="https://picsum.photos/id/22/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">机器学习爱好者</div>
                    <div class="topic-time">3天前</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">讨论：大语言模型的局限性及未来发展方向</div>
                
                <div class="topic-text">
                    虽然大语言模型取得了惊人的进步，但仍存在诸多局限：1. 事实准确性问题；2. 推理能力有限；3. 缺乏真正的理解；4. 易受提示词影响...
                    大家认为未来的突破点会在哪里？是多模态融合，还是引入更好的推理机制，或者是其他方向？
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#人工智能#</span>
                    <span class="topic-tag">#大语言模型#</span>
                    <span class="topic-tag">#机器学习#</span>
                    <span class="topic-tag">#技术讨论#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>12.3k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>567 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (1.8k)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <button class="load-more" id="loadMoreBtn">
            <i class="fas fa-spinner fa-spin"></i>
            <span>加载更多话题</span>
        </button>
    </div>
    
    <!-- 空状态 -->
    <div class="empty-state" id="emptyState">
        <div class="empty-icon">
            <i class="fas fa-search"></i>
        </div>
        <div class="empty-text">没有找到符合条件的话题</div>
        <button class="reset-all-btn" id="resetAllBtn">重置所有筛选条件</button>
    </div>
    
    <!-- 创建话题按钮 -->
    <button class="fab-create" id="createTopicBtn">
        <i class="fas fa-plus"></i>
    </button>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-comments nav-icon"></i>
            <span>话题</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const messageBtn = document.getElementById('messageBtn');
        const createTopicBtn = document.getElementById('createTopicBtn');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        const searchInput = document.querySelector('.search-input');
        const toast = document.getElementById('toast');
        const emptyState = document.getElementById('emptyState');
        const resetAllBtn = document.getElementById('resetAllBtn');
        const clearAllFiltersBtn = document.getElementById('clearAllFilters');
        
        // 筛选面板元素
        const filterBtns = document.querySelectorAll('.filter-btn');
        const categoryFilterBtn = document.getElementById('categoryFilterBtn');
        const advancedFilterBtn = document.getElementById('advancedFilterBtn');
        const tagFilterBtn = document.getElementById('tagFilterBtn');
        const sortFilterBtn = document.getElementById('sortFilterBtn');
        
        const categoryFilterPanel = document.getElementById('categoryFilterPanel');
        const advancedFilterPanel = document.getElementById('advancedFilterPanel');
        const tagFilterPanel = document.getElementById('tagFilterPanel');
        const sortFilterPanel = document.getElementById('sortFilterPanel');
        
        const categoryTags = document.querySelectorAll('.category-tag');
        const filterOptions = document.querySelectorAll('.filter-option');
        const tagItems = document.querySelectorAll('.tag-item');
        const applyAdvancedFilterBtn = document.getElementById('applyAdvancedFilter');
        const resetAdvancedFilterBtn = document.getElementById('resetAdvancedFilter');
        const applySortFilterBtn = document.getElementById('applySortFilter');
        const resetSortFilterBtn = document.getElementById('resetSortFilter');
        const removeFilterBtns = document.querySelectorAll('.remove-filter');
        const activeFiltersContainer = document.getElementById('activeFiltersContainer');
        
        // 所有筛选面板
        const filterPanels = [
            categoryFilterPanel,
            advancedFilterPanel,
            tagFilterPanel,
            sortFilterPanel
        ];
        
        // 显示提示消息
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            clearTimeout(toast.timeout);
            toast.timeout = setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 切换筛选面板显示
        function switchFilterPanel(panelToShow) {
            // 隐藏所有面板
            filterPanels.forEach(panel => {
                panel.classList.remove('show');
            });
            
            // 显示目标面板
            panelToShow.classList.add('show');
            
            // 更新按钮状态
            filterBtns.forEach(btn => btn.classList.remove('active'));
            if (panelToShow === categoryFilterPanel) {
                categoryFilterBtn.classList.add('active');
            } else if (panelToShow === advancedFilterPanel) {
                advancedFilterBtn.classList.add('active');
            } else if (panelToShow === tagFilterPanel) {
                tagFilterBtn.classList.add('active');
            } else if (panelToShow === sortFilterPanel) {
                sortFilterBtn.classList.add('active');
            }
        }
        
        // 初始化筛选面板状态
        function initFilterPanels() {
            categoryFilterPanel.classList.add('show');
            advancedFilterPanel.classList.remove('show');
            tagFilterPanel.classList.remove('show');
            sortFilterPanel.classList.remove('show');
        }
        
        // 处理分类标签点击
        categoryTags.forEach(tag => {
            tag.addEventListener('click', function() {
                // 移除同组其他标签的active类
                categoryTags.forEach(t => t.classList.remove('active'));
                // 给当前点击的标签添加active类
                this.classList.add('active');
                
                const filterText = this.textContent;
                showToast(`已筛选: ${filterText}`);
                
                // 更新活跃筛选条件
                updateActiveFilters('category', filterText);
            });
        });
        
        // 处理筛选选项点击
        filterOptions.forEach(option => {
            option.addEventListener('click', function() {
                // 找到同组的其他选项
                const parentGroup = this.closest('.filter-options');
                parentGroup.querySelectorAll('.filter-option').forEach(opt => {
                    opt.classList.remove('active');
                });
                
                // 给当前点击的选项添加active类
                this.classList.add('active');
                
                // 处理自定义日期显示
                if (this.textContent === '自定义' && this.closest('.filter-section').querySelector('.filter-title').textContent === '时间范围') {
                    this.closest('.filter-section').querySelector('.date-range').style.display = 'flex';
                } else if (this.closest('.filter-section').querySelector('.filter-title').textContent === '时间范围') {
                    this.closest('.filter-section').querySelector('.date-range').style.display = 'none';
                }
            });
        });
        
        // 处理标签云点击
        tagItems.forEach(tag => {
            tag.addEventListener('click', function() {
                // 全部标签特殊处理
                if (this.textContent === '全部标签') {
                    tagItems.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');
                    showToast('已显示全部标签内容');
                    
                    // 移除所有标签筛选
                    removeAllFiltersByType('tag');
                } else {
                    // 切换当前标签状态
                    this.classList.toggle('active');
                    
                    if (this.classList.contains('active')) {
                        showToast(`已添加标签筛选: ${this.textContent}`);
                        // 添加到活跃筛选
                        updateActiveFilters('tag', this.textContent);
                    } else {
                        showToast(`已移除标签筛选: ${this.textContent}`);
                        // 从活跃筛选中移除
                        removeFilterByValue(this.textContent);
                    }
                }
            });
        });
        
        // 更新活跃筛选条件显示
        function updateActiveFilters(type, value) {
            // 如果是分类筛选，先移除其他分类筛选
            if (type === 'category') {
                const categoryFilters = activeFiltersContainer.querySelectorAll('.active-filter-tag');
                categoryFilters.forEach(filter => {
                    // 判断是否是分类筛选（简单判断，实际应用中可添加data属性区分）
                    if (!filter.textContent.includes('#')) {
                        filter.remove();
                    }
                });
            }
            
            // 创建新的筛选标签
            const filterTag = document.createElement('div');
            filterTag.className = 'active-filter-tag';
            filterTag.innerHTML = `${value} <button class="remove-filter"><i class="fas fa-times"></i></button>`;
            
            // 添加到容器
            activeFiltersContainer.appendChild(filterTag);
            
            // 绑定移除事件
            filterTag.querySelector('.remove-filter').addEventListener('click', function() {
                filterTag.remove();
                showToast(`已移除筛选: ${value}`);
                
                // 同步更新对应筛选器状态
                if (type === 'category') {
                    categoryTags.forEach(tag => {
                        if (tag.textContent === value) {
                            tag.classList.remove('active');
                        }
                    });
                    // 激活"全部话题"
                    categoryTags[0].classList.add('active');
                } else if (type === 'tag') {
                    tagItems.forEach(tag => {
                        if (tag.textContent === value) {
                            tag.classList.remove('active');
                        }
                    });
                }
            });
        }
        
        // 按值移除筛选条件
        function removeFilterByValue(value) {
            const filters = activeFiltersContainer.querySelectorAll('.active-filter-tag');
            filters.forEach(filter => {
                if (filter.textContent.includes(value)) {
                    filter.remove();
                }
            });
        }
        
        // 按类型移除所有筛选条件
        function removeAllFiltersByType(type) {
            const filters = activeFiltersContainer.querySelectorAll('.active-filter-tag');
            filters.forEach(filter => {
                if (type === 'tag' && filter.textContent.includes('#')) {
                    filter.remove();
                }
            });
        }
        
        // 清除所有筛选条件
        function clearAllFilters() {
            activeFiltersContainer.innerHTML = '';
            
            // 重置所有筛选器状态
            categoryTags.forEach((tag, index) => {
                tag.classList.remove('active');
                if (index === 0) tag.classList.add('active'); // 激活"全部话题"
            });
            
            filterOptions.forEach((option, index, array) => {
                const parentGroup = option.closest('.filter-options');
                if (Array.from(parentGroup.children).indexOf(option) === 0) {
                    option.classList.add('active');
                } else {
                    option.classList.remove('active');
                }
            });
            
            tagItems.forEach((tag, index) => {
                tag.classList.remove('active');
                if (index === 0) tag.classList.add('active'); // 激活"全部标签"
            });
            
            // 隐藏日期范围
            document.querySelectorAll('.date-range').forEach(range => {
                range.style.display = 'none';
            });
            
            showToast('已清除所有筛选条件');
        }
        
        // 应用高级筛选
        applyAdvancedFilterBtn.addEventListener('click', function() {
            // 收集选中的筛选条件
            const selectedFilters = [];
            document.querySelectorAll('#advancedFilterPanel .filter-option.active').forEach(option => {
                selectedFilters.push(option.textContent);
            });
            
            // 更新活跃筛选显示
            selectedFilters.forEach(filter => {
                if (filter !== '全部时间' && filter !== '全部内容' && filter !== '全部' && filter !== '全部作者') {
                    updateActiveFilters('advanced', filter);
                }
            });
            
            showToast(`已应用 ${selectedFilters.length} 个筛选条件`);
            
            // 切换回分类面板
            switchFilterPanel(categoryFilterPanel);
        });
        
        // 重置高级筛选
        resetAdvancedFilterBtn.addEventListener('click', function() {
            const options = document.querySelectorAll('#advancedFilterPanel .filter-option');
            options.forEach((option, index, array) => {
                const parentGroup = option.closest('.filter-options');
                if (Array.from(parentGroup.children).indexOf(option) === 0) {
                    option.classList.add('active');
                } else {
                    option.classList.remove('active');
                }
            });
            
            // 隐藏日期范围
            document.querySelectorAll('.date-range').forEach(range => {
                range.style.display = 'none';
            });
            
            showToast('已重置筛选条件');
        });
        
        // 应用排序筛选
        applySortFilterBtn.addEventListener('click', function() {
            const selectedSort = document.querySelector('#sortFilterPanel .filter-section:first-child .filter-option.active').textContent;
            const selectedDensity = document.querySelector('#sortFilterPanel .filter-section:last-child .filter-option.active').textContent;
            
            showToast(`已应用排序: ${selectedSort}，显示模式: ${selectedDensity}`);
            
            // 切换回分类面板
            switchFilterPanel(categoryFilterPanel);
        });
        
        // 重置排序筛选
        resetSortFilterBtn.addEventListener('click', function() {
            const options = document.querySelectorAll('#sortFilterPanel .filter-option');
            options.forEach((option, index, array) => {
                const parentGroup = option.closest('.filter-options');
                if (Array.from(parentGroup.children).indexOf(option) === 0) {
                    option.classList.add('active');
                } else {
                    option.classList.remove('active');
                }
            });
            
            showToast('已重置排序条件');
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin"></i><span> 加载中...</span>';
            setTimeout(() => {
                this.innerHTML = '<i class="fas fa-plus"></i><span> 加载更多话题</span>';
                showToast('已加载更多话题');
            }, 1500);
        });
        
        // 搜索功能
        searchInput.addEventListener('keyup', function(e) {
            if (e.key === 'Enter' && this.value.trim()) {
                showToast(`搜索: ${this.value}`);
                // 在实际应用中，这里会触发搜索请求
            }
        });
        
        // 绑定事件
        backBtn.addEventListener('click', () => showToast('返回上一页'));
        messageBtn.addEventListener('click', () => showToast('查看消息通知'));
        createTopicBtn.addEventListener('click', () => showToast('创建新话题'));
        clearAllFiltersBtn.addEventListener('click', clearAllFilters);
        resetAllBtn.addEventListener('click', function() {
            clearAllFilters();
            emptyState.classList.remove('show');
            document.querySelector('.topics-container').style.display = 'block';
        });
        
        // 绑定筛选面板切换事件
        categoryFilterBtn.addEventListener('click', () => switchFilterPanel(categoryFilterPanel));
        advancedFilterBtn.addEventListener('click', () => switchFilterPanel(advancedFilterPanel));
        tagFilterBtn.addEventListener('click', () => switchFilterPanel(tagFilterPanel));
        sortFilterBtn.addEventListener('click', () => switchFilterPanel(sortFilterPanel));
        
        // 初始化已有的移除筛选按钮事件
        removeFilterBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const filterTag = this.closest('.active-filter-tag');
                const filterText = filterTag.textContent.trim().replace('×', '').trim();
                filterTag.remove();
                showToast(`已移除筛选: ${filterText}`);
            });
        });
        
        // 初始化
        function init() {
            initFilterPanels();
        }
        
        init();
    </script>
</body>
</html>
